package com.liuc.practice.ipersistent.sqlSession.impl;

import com.liuc.practice.ipersistent.pojo.Configuration;
import com.liuc.practice.ipersistent.sqlSession.SqlSession;
import com.liuc.practice.ipersistent.sqlSession.SqlSessionFactory;

/**
 * 该类用于创建 SqlSession 实例
 *
 * @Author Liu Chang
 * @Date 2020/12/13 6:48 上午
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {
    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSqlSession() {
        return new DefaultSqlSession(configuration);
    }
}
